/*
 * Copyright 2025 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
 */

package dev.icerock.moko.resources
import dev.icerock.moko.resources.utils.OhosResourceUtils
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.toKString

actual class FileResource(
    val rawResName: String
) {
    fun getFile() : ByteArray = OhosResourceUtils.getFile(rawResName)?:throw Exception()

    @OptIn(ExperimentalForeignApi::class)
    fun test() {
        val testArray = getFile()
        val len = testArray.size
        val str = testArray.toKString()
        println("test FileResource:")
        println("array len: $len")
        println("array str: $str")
    }
}